package com.jdk8.bean;

import java.util.List;

public class Book implements Comparable<Book>{
	private  String title;
	private  String author;
	private  List<String> tags;
	private int price;


	public String getTitle() {
		return title;
	}

	public String getAuthor() {
		return author;
	}

	public List<String> getTags() {
		return tags;
	}
	

	public Book() {
		super();
	}

	public Book(int price) {
		this.price = price;
	}
	public Book(String title, int price) {
		super();
		this.title = title;
		this.price = price;
	}
	public Book(String title, String author, List<String> tags) {
		super();
		this.title = title;
		this.author = author;
		this.tags = tags;
	}
	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	@Override
	public String toString() {
		return "Book [title=" + title + ", author=" + author + ", tags=" + tags + "]";
	}

	@Override
	public int compareTo(Book bk) {
		return this.price-bk.getPrice();
	}
   
	public static int compareBookeByPrice(Book bk1,Book bk0) {
		return bk1.getPrice()-bk0.getPrice();
	}
}
